import axios from '../server/interface/utils/axios'



export const actions = {
  async nuxtServerInit({
    commit
  }, { req }) {
    const {
      status,
      data: {
        province,
        city
      }
    } = await axios.get('/geo/getPosition')
    commit('geo/setPosition', status === 200 ? { city, province } : { city: '', province: '' })
    const { status: status2, data: { menu } } = await axios.get('geo/menu')
    commit('home/setMenu', status2 === 200 ? menu : [])
  }
}


